import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        int[] nums = new int[n];
        PriorityQueue<Integer> heap = new PriorityQueue<>((a,b)-> b-a);
        long sum = 0;
        for(int i=0;i<n;i++) {
            nums[i] = in.nextInt();
            if(nums[i] % 2 == 0)
                heap.add(nums[i]);
            sum += nums[i];
        }

        for(int i=0;i<k;i++) {
            if(heap.isEmpty()) break; // 没有偶数了，提前结束
            int x = heap.poll();
            int newx = x/2;
            sum -= (newx);
            if(newx % 2 == 0)
                heap.add(newx);
        }
        System.out.println(sum);
    }
}